/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ourvod.util;

import net.jxta.content.ContentID;
import net.jxta.id.IDFactory;
import net.jxta.peergroup.PeerGroup;
import net.jxta.peergroup.PeerGroupID;
import net.jxta.platform.ModuleClassID;
import net.jxta.platform.ModuleSpecID;

/**
  * A simple application to generate a Module Class ID, Module Specification ID, Peer
  * Group ID, and Module Specification ID based on the standard peer group Module Class ID.
  * 
  * @author cuizhenfu@gmail.com
  *
  */
 public class GeneratorID {
 
     /**
      * Generates the IDs.
      * 
      * @param args    the command-line arguments. Ignored by this app.
      */
     public static void main(String[] args) {
         // Create an entirely new Module Class ID.
         ModuleClassID classID = IDFactory.newModuleClassID();
         
         // Create a Module Specification ID based on the generated Module Class ID.
         ModuleSpecID specID = IDFactory.newModuleSpecID(classID);
         
         // Create an entirely new Peer Group ID.
         PeerGroupID groupID = IDFactory.newPeerGroupID();
         
         // Create a Module Specification ID based on the peer group Module Class ID.
         ModuleSpecID groupSpecID = IDFactory.newModuleSpecID(PeerGroup.allPurposePeerGroupSpecID.getBaseClass());
         
         ContentID contentID = IDFactory.newContentID(groupID, true);
         
         // Print out the generated IDs.
         System.out.println("Module Class ID: " + classID.toURI());
         System.out.println("Module Spec ID: " + specID.toURI());
         System.out.println("Peer Group ID: " + groupID.toURI());
         System.out.println("Peer Group Module Spec ID: " + groupSpecID.toURI());
     }
 
}